/**
 * 
 */
package com.james.wee.shuangseqiu.bo;

import com.james.wee.shuangseqiu.dafenqissq.DaFenQiSSQ;

/**
 * @author JamesWee
 * 
 */
public class ShaNum {
	private String xingsha;
	private String xiangjian;
	private String jianlan;
	private String jianAC;
	private String hezhisplit;
	private String weizhisplit;
	private String shangliangqi;
	private String chengjian;
	private String meisha;
	private String onepwd;
	private String twopwd;
	private String threepwd;
	private String fourpwd;
	private String openNumber;

	public ShaNum(OpenNumber open, DaFenQiSSQ dsq, String weisha,
			String openNumber) {
		this.setXingsha(open.getXingsha());
		this.setXiangjian(open.getKaijiangxiangjian());
		this.setJianlan(open.getKaijiangjianlan());
		this.setJianAC(open.getKaijiangjianac());
		this.setHezhisplit(open.getKaijianghezhisplit());
		this.setWeizhisplit(open.getKaijiangweihesplit());
		this.setShangliangqi(open.getKaijiangliangqijian());
		this.setChengjian(open.getMuiltyhezhisplit());
		this.setMeisha(weisha);
		this.setOnepwd(dsq.calcOpenNumFirstPWD());
		this.setTwopwd(dsq.calcOpenNumTwoPWD());
		this.setThreepwd(dsq.calcOpenNumThreePWD());
		this.setFourpwd(dsq.calcOpenNumFourPWD());
		this.openNumber = openNumber;
	}

	public ShaNum(String xingsha, String xiangjian, String jianlan,
			String jianAC, String hezhisplit, String weizhisplit,
			String shangliangqi, String chengjian, String meisha,
			String onepwd, String twopwd, String threepwd, String fourpwd) {
		this.xingsha = xingsha;
		this.xiangjian = xiangjian;
		this.jianlan = jianlan;
		this.jianAC = jianAC;
		this.hezhisplit = hezhisplit;
		this.weizhisplit = weizhisplit;
		this.shangliangqi = shangliangqi;
		this.chengjian = chengjian;
		this.meisha = meisha;
		this.onepwd = onepwd;
		this.twopwd = twopwd;
		this.threepwd = threepwd;
		this.fourpwd = fourpwd;
	}

	public String getXingsha() {
		return toRedComm(xingsha);
	}

	public void setXingsha(String xingsha) {
		this.xingsha = xingsha;
	}

	public String getXiangjian() {
		return toRedComm(xiangjian);
	}

	public void setXiangjian(String xiangjian) {
		this.xiangjian = xiangjian;
	}

	public String getJianlan() {
		return toRedComm(jianlan);
	}

	public void setJianlan(String jianlan) {
		this.jianlan = jianlan;
	}

	public String getJianAC() {
		return toRedComm(jianAC);
	}

	public void setJianAC(String jianAC) {
		this.jianAC = jianAC;
	}

	public String getHezhisplit() {
		return toRedComm(hezhisplit);
	}

	public void setHezhisplit(String hezhisplit) {
		this.hezhisplit = hezhisplit;
	}

	public String getWeizhisplit() {
		return toRedComm(weizhisplit);
	}

	public void setWeizhisplit(String weizhisplit) {
		this.weizhisplit = weizhisplit;
	}

	public String getShangliangqi() {
		return toRedComm(shangliangqi);
	}

	public void setShangliangqi(String shangliangqi) {
		this.shangliangqi = shangliangqi;
	}

	public String getChengjian() {
		return toRedComm(chengjian);
	}

	public void setChengjian(String chengjian) {
		this.chengjian = chengjian;
	}

	public String getMeisha() {
		return toRedComm(meisha);
	}

	public void setMeisha(String meisha) {
		this.meisha = meisha;
	}

	public String getOnepwd() {
		return toRedComm(onepwd);
	}

	public void setOnepwd(String onepwd) {
		this.onepwd = onepwd;
	}

	public String getTwopwd() {
		return toRedComm(twopwd);
	}

	public void setTwopwd(String twopwd) {
		this.twopwd = twopwd;
	}

	public String getThreepwd() {
		return toRedComm(threepwd);
	}

	public void setThreepwd(String threepwd) {
		this.threepwd = threepwd;
	}

	public String getFourpwd() {
		return toRedComm(fourpwd);
	}

	public void setFourpwd(String fourpwd) {
		this.fourpwd = fourpwd;
	}

	public String getOpenNumber() {
		return openNumber;
	}

	public void setOpenNumber(String openNumber) {
		this.openNumber = openNumber;
	}

	private String toRedComm(String str) {
		 
		if (null != openNumber && null!=str) {
			String[] s = openNumber.split(",");
			for (String a : s) {
				if (str.contains(a)) {
					str=str.replace(a, "<font color=\"red\">"+a+"</font>");
				}
			}
		}
		return str;
	}
}
